<?php

namespace api\models;

use Yii;

/**
 * This is the model class for table "user".
 *
 * @property integer $id
 * @property string $username
 * @property string $icon
 * @property integer $sex
 * @property string $phone
 * @property string $signature
 * @property integer $age
 * @property integer $emotional
 * @property string $hometown
 * @property string $professional
 * @property integer $start
 * @property double $userMoney
 * @property string $access_token
 * @property integer $cid
 * @property integer $is_anchor
 * @property integer $is_realname
 * @property string $login_time
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['sex', 'age', 'emotional', 'start', 'cid', 'is_anchor', 'is_realname'], 'integer'],
            [['userMoney'], 'number'],
            [['username', 'hometown', 'professional'], 'string', 'max' => 32],
            [['icon', 'signature'], 'string', 'max' => 322],
            [['phone'], 'string', 'max' => 20],
            [['access_token', 'login_time'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'username' => Yii::t('app', '用户名'),
            'icon' => Yii::t('app', '用户头像'),
            'sex' => Yii::t('app', '性别'),
            'phone' => Yii::t('app', '手机号'),
            'signature' => Yii::t('app', '个性签名'),
            'age' => Yii::t('app', '年龄'),
            'emotional' => Yii::t('app', '情感状态'),
            'hometown' => Yii::t('app', '家乡'),
            'professional' => Yii::t('app', '职业'),
            'start' => Yii::t('app', '状态'),
            'userMoney' => Yii::t('app', '余额'),
            'access_token' => Yii::t('app', '权限认证'),
            'cid' => Yii::t('app', '分类id'),
            'is_anchor' => Yii::t('app', '是否是主播'),
            'is_realname' => Yii::t('app', 'Is Realname'),
            'login_time' => Yii::t('app', '登录时间'),
        ];
    }
}
